home *** CD-ROM | disk | FTP | other *** search
- Path: dnt.dialog.com!news
- From: Paul Gorodyansky <paul_gorodyansky@corp.dialog.com>
- Newsgroups: comp.lang.pl1,comp.lang.c
- Subject: Re: PL/I and C
- Date: Thu, 22 Feb 1996 12:14:42 -0800
- Organization: Knight-Ridder Information, Inc.
- Message-ID: <312CCEB2.4AB7@corp.dialog.com>
- References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU>
- NNTP-Posting-Host: pc3046.corp.dialog.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-2
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Mike Presseller <mpressel@research.westlaw.com> wrote:
- > I am in the process of evaluating the development of Mainframe
- > applications using C/370 and PLI under MVS.
-
- For the jobs you mentioned:
- > text conversions, database maintenance and development,
- > and other I/O intensive routines
- PL/I is MUCH better (I am talking about mainframe):
-
- I. Text Processing.
- ---------------
- C does not have so extensive Text Processing built-in functions,
- as PL/I does. Moreover, C has this STUPID limitation - a 'string'
- in C it's a set of bytes with x'00' at the end ! But, we have
- x'00' all over our source data ! It's the same symbol as any other,
- there is nothing special in it. So, I HAD TO write myself ALL
- string functions (sub-string, search,..) using BUFFERS, because I
- was not able to use C 'String' functions. Obviously, functions
- written by me are not so efficient as Built-in functions,
- so the productivity suffers.
- Also, C does not have Variable Length strings.
- Again, PL/I has BUILT-IN, effective string functions.
-
- II. Data Structures.
- ---------------
- In PL/I, you can consider your source record as a string,
- or as SEVERAL different complex Structures, using Based variables.
- C has it, too, but with a BIG limitation - if you want to put
- SEVERAL different 'masks' over your buffer, C allows ONLY simple
- variables as items of these structures, not Arrays !
-
- III. Select/Switch statement.
- -----------------------
- This important part of any program is VERY rudimental and hard
- to use in C - you can use ONLY numbers here:
- switch(my_choice) {
- case 0:
- ....
- break;
- case 1:
- ....
- }
-
- You can use Enumerations in C but they are still only NUMBERS.
- In PL/I you can use any Expression (!) as a switch, that is, you
- can use Character Strings here, that helps a lot while writing
- Text Processing programs.
- ----
- As I heard, C was developed mostly for COMPUTATIONAL tasks - its
- Text Processing options are limited.
-
- IV. Fixing a problem, debugging. Maintenance.
- ----------------------------------------
- 1) C compiler DOESN'T tell me where in my LARGE set of programs
- a failure occurred, unlike PL/I that tells me a Statement Number.
- ( C can do it, but you must buy and use an Additional product -
- debugger - 'Inspect for C'. But I am afraid, it's too costly in
- a matter of time to run your Production Jobs always with Debugger).
- Imagine, some Production Update failed. Source file is HUGE.
- Angry Customers call from all over the world.
- This large set of programs IS NOT mine. So, I never saw neither
- Source data, nor Programming Code. I MUST fix the problem in
- a short time. In C environment I HAVE TO RE-RUN (!!) whole thing
- using debugger, just to BEGIN my investigation.
- In my opinion, it is ABSOLUTELY unacceptable in Production
- (not Research) environment.
- And the following 2 things support this point:
-
- 2) C programs are hard to maintain, code is not easy to read.
- So, in the situation I described, where this large set of programs
- is 'old' and was already modified several times by several engineers,
- it is EXTREMELY hard for a person who sees these programs FIRST TIME,
- to investigate and fix a problem, especially in a short time.
- UNLIKE PL/I, where even not a super-programmer can easily read a
- source code.
-
- 3) Exception(Error) Handling. C does not have it, and as far as I
- know, current version of mainframe C++ does not have it, either.
- What it means... PL/I not only tells me WHERE a failure occurred
- (see item 1), but it offers me ON ERROR feature, so I know
- 2 VERY important things that allow me often DO NOT check HUGE
- source files or HUGE programs and to fix a problem in couple hours:
- a) It tells me THE REASON for failure (I don't need to spend hours
- and re-run entire job with debugger to find out the reason),
- for example, some I/O problem.
- b) Because I asked so in ON ERROR block, I have, in failed job's
- listing, values of some key variables and, THE BEST, part of
- source file data where error occurred. Without debugger re-run,
- I can see IMMEDIATELY, that, for example, this source file has
- 'dirty' data. So, I DON'T need to investigate a program's CODE at all !
- Again, imagine 40 gigabyte file (!) that you have to re-run
- using debugger in C environment JUST TO BEGIN your investigation,
- while with PL/I this investigation is already done !
-
- So, my point is, PL/I is not only BETTER that C, because PL/I code is more
- readable and programs are easy to maintain, but it is just IRREPLACEABLE.
-
- P.S. If you need more language specific information in regards
- to functionality, performance, etc., then read article by
- Eberhard Sturm ( GUIDE & SHARE Conference, 1994 )
- "Power Vs Adventure - PL/I and C". WWW address is:
- http://www.uni-muenster.de/URZ/Mitarbeiter/EberhardSturm/PL1andC.html
-
- --
- Paul Gorodyansky mailto:paul_gorodyansky@corp.dialog.com
-